
from tkinter import*

print('X:')
X = int(input())
print('Y:')
Y = int(input())
print('N:')
N = int(input())


coords = [10,0,10,10,20,10,20,20,20,30,10,30,10,20,0,20,0,0
        ]

count = 0
for i in coords:

    if(count % 2 == 0):
        coords[count] = i * N + X
    if(count % 2 == 1):
        coords[count] = i * N + Y

    count += 1

if N == 0 and X>=0 and X<=500 and Y>=0 and Y<=500:
    pass
else:
    if N > 0 and 0*N+X>=0 and 0*N+Y>=0 and 20*N+X<=500 and 20*N+Y<=500:
        pass
    else:
        if N <0 and 20*N+X>=0 and 20*N+Y>=0 and 0*N+X<=500 and 0*N+Y<=500:
            pass
        else:
            print('Размер фигуры превышает максимальный размер поля')
            exit()


root = Tk()
root["bg"] = "#fafafa"
root.title("Холст")
root.wm_attributes("-alpha", 0.8)
root.geometry("500x500")
root.resizable(width=False, height=False)



canvas = Canvas(bg="lavender", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)
canvas.create_polygon (coords)
frame = Frame(root, bg="black")
frame.place(relx=1,rely=1, relwidth=1,relheight=1)



root.mainloop()
